package book;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 28318
 * Date: 2025-10-25
 * Time: 16:54
 */
public class Bookshelf {
    private int bookUsed;

    public Book[] bookshelf = new Book[5];

    public Bookshelf() {
        this.bookshelf[0] = new Book("西游记","吴承恩",25,"小说");
        this.bookshelf[1] = new Book("三国演义","罗贯中",23,"小说");
        this.bookshelf[2] = new Book("水浒传","施耐庵",29,"小说");
        this.bookshelf[3] = new Book("红楼梦","曹雪芹",24,"小说");
        this.bookUsed = 4;
    }

    public void addBook(int address,Book newBook){
        this.bookshelf[address] = newBook;
    }

    public int getBookUsed() {
        return bookUsed;
    }

    public void setBookUsed(int bookUsed) {
        this.bookUsed = bookUsed;
    }

    public Book[] getBookshelf() {
        return bookshelf;
    }

    public void setBookshelf(Book[] bookshelf) {
        this.bookshelf = bookshelf;
    }


}
